from django.db import models
from datetime import datetime
from django.utils.timezone import now


class User(models.Model):
    id = models.CharField(db_column="c_id", max_length=32, verbose_name=u"主键", primary_key=True, blank=False,
                          null=False)
    username = models.CharField(db_column="c_username", max_length=20, verbose_name="用户名", unique=True, null=False,
                                blank=False)
    password = models.CharField(db_column="c_password", max_length=20, verbose_name="密码", null=False, blank=False)
    is_active = models.BooleanField(db_column="c_is_active", default=True)
    is_delete = models.BooleanField(db_column="c_is_delete", default=False)
    create_date = models.DateTimeField(db_column="c_create_date", default=now)
    update_date = models.DateTimeField(db_column="c_update_date", default=now)

    class Meta:
        db_table = "t_user"
        verbose_name = "用户表"
        verbose_name_plural = verbose_name
        ordering = ["create_date"]
